<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8" name="viewport" content="initial-scale=1,width=device-width,maximum-scale=1,user-scalable=no">
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> 
		<title>三峡大学计算机协会</title>
		<link rel="stylesheet" href="../css/com.css" />
		<link rel="stylesheet" href="../css/index-css/header.css" />
		<link rel="stylesheet" href="../css/register-css/section.css" />
		<link rel="stylesheet" href="../css/index-css/footer.css" />
		<script type="text/javascript" src="../js/jquery/jquery.min.js"></script>
		<script type="text/javascript" src="../js/to-admin.js"></script>
	</head>
<script>
	$(document).ready(function(){
		var sex='男';
		//为性别选择按钮绑定事件
		$('section div.sex>button').eq(0).click(function(){
			sex='男';
//			console.log(sex);
			$(this).addClass('sex-active');
			$('section div.sex>button').eq(1).removeClass('sex-active');
		});
		$('section div.sex>button').eq(1).click(function(){
			sex='女';
//			console.log(sex);
			$(this).addClass('sex-active');
			$('section div.sex>button').eq(0).removeClass('sex-active');
		});
		
		//为提交注册信息绑定事件,当通过正则表达式后会触发这个事件
		$('section>form').submit(function(){
			var sid=$('section>form>input').eq(0).val();
			var name=$('section>form>input').eq(1).val();
			var major=$('section>form>input').eq(2).val();
			var tel=$('section>form>input').eq(3).val();
			var address=$('section>form>select:nth-of-type(1)>option:checked').val();
			var will=$('section>form>select:nth-of-type(2)>option:checked').val();
			var datas={
				'sid':sid,
				'name':name,
				'sex':sex,
				'major':major,
				'tel':tel,
				'address':address,
				'will':will
			}
			//使用ajax提交注册信息
			$.ajax({
				type:"post",
				url:"/ctguca/registe/submit",
				async:false,//使用同步传输数据
				data:datas,
				success:function(data){
					switch (parseInt(data)){
						case 1:
							alert('注册成功!  请加入招新群：836136380 接受通知');
							$('section>form')[0].reset();
							break;
						case 0:
							alert('该学号已被注册，若他人误用，请QQ联系协会人员');
							break
						default:
							alert('注册失败！请稍后重试');
							break;
					}
					/* console.log(data); */
				},
				error:function(){
					alert("网络故障，请稍后重试");
				}
			});
			/* console.log(datas); */
			return false;
		});
	})
</script>	
		<header>
			<ul>
				<li><img src="../img/index-img/logo2.png" />
					<a href="#">CTGUCA</a>
				</li>
				<li>
					<a href="../index.html">首页</a>
				</li>
				<li>
					<a href="about.html">简介</a>
				</li>
				<li>
					<a href="news.html">活动</a>
				</li>
				<li>
					<a href="resource.html">资源</a>
				</li>
				<li>
					<a href="register.html">加入我们</a>
				</li>
			</ul>
		</header>
	<section>
		<form>
			<input type="text" name="sid" placeholder="学号" required="required" pattern="^(201[678]\d{4}(0[1-9])|([1-9]\d{1}))$">
			<input type="text" name="name" placeholder="姓名" required="required" maxlength="25">
			<div class="sex">
				<button class="sex-active">男生</button>
				<button>女生</button>
			</div>
			<input type="text" name="major" placeholder="专业"  required="required" maxlength="20" >
			<input type="text" name="tel" placeholder="电话"  required="required" pattern="^(1[3578][0-9]{9})$" >
			<span class="re-name">苑区</span>
			<select name="address">
				<option selected="selected" value="欣苑">欣苑</option>
				<option value="沁苑">沁苑</option>
				<option value="南苑">南苑</option>
				<option value="欣苑">欣苑</option>
				<option value="西苑">西苑</option>
				<option value="东苑">东苑</option>
			</select> <span class="re-name">意愿</span>
			<select name="will">
				<option value="会员">会员</option>
				<option value="建站组" selected="selected">建站组</option>
				<option value="组织部">组织部</option>
				<option value="美宣部">美宣部</option>
				<option value="技术部">技术部</option>
				<option value="编程部">编程部</option>
				<option value="秘书处">秘书处</option>
				<option value="办公部">办公部</option>
			</select>
			<input type="submit" value="立即注册">
		</form>
	</section>
			<footer>
		<ul>
			<li>
				<dt>常用资源</dt>
				<dd>
					<a
						href="https://sm.myapp.com/original/Development/Dev-Cpp_5.11_TDM-GCC_4.9.2_Setup.exe">dev-c++</a>
				</dd>
				<dd>
					<a href="http://dl-t1.wmzhe.com/30/30118/jdk_8.0.1310.11_64.exe">jdk1.8下载</a>
				</dd>
				<dd>
					<a
						href="http://wangshuo.jb51.net:81/201806/tools/eclipse_photo_win64_jb51.rar">eclipse4.8下载</a>
				</dd>
			</li>
			<li>
				<dt>关于我们</dt>
				<dd>
					<a href="about_detail">计协简介</a>
				</dd>
				<dd>
					<a href="tel.html">联系我们</a>
				</dd>
				<dd>
					<a href="#" id="a-requery">反馈建议</a>
				</dd>
			</li>
			<li>
				<dt>会员服务</dt>
				<dd>
					<a href="#" onclick="javascript:alert('暂未开放！');">近期讲座</a>
				</dd>
				<dd>
					<a href="#" onclick="javascript:alert('暂未开放！');">近期活动</a>
				</dd>
				<dd>
					<a target="_blank" href="/ctguca/luntan.html">问题解答</a>
				</dd>
			</li>
			<li>
				<dt>友情链接</dt>
				<dd>
					<a href="http://www.cnki.net/" data-toggle="tooltip"
						data-placement="right" title="校内网可免费下载" target="_blank">中国知网</a>
				</dd>
				<dd>
					<a href="https://www.nowcoder.com/" data-toggle="tooltip"
						data-placement="right" title="学习资源网站" target="_blank">牛客网</a>
				</dd>
				<dd>
					<a href="http://jwc.ctgu.edu.cn/fwqxztt.asp" data-toggle="tooltip"
						data-placement="right" title="学生选课入口" target="_blank">三峡大学教务处</a>
				</dd>
				<dd>
					<a href="http://210.42.41.119/" target="_blank">三峡大学图书馆</a>
				</dd>
			</li>
		</ul>
		<div>
			<hr color="#fff" size="1.5" />
			<p>
				©2018--2020 CTGU CA , 三峡大学计算机协会 | All rights reserved. <a href="#"
					id="admin-login">后台管理</a>
			</p>
		</div>
	</footer>
	<div class="me-bg"></div>
	<div class="me-con">
		<h4>后台管理登录</h4>
		<lable>&Chi;</lable>
		<form action="" method="post">
			<input type="text" maxlength="20" placeholder="账号"
				pattern="^([0-9a-zA-Z]{4,})$" /> <input type="password"
				maxlength="20" placeholder="密码" pattern="^([0-9a-zA-Z]{4,})$" /> <input
				type="submit" value="登录" />
		</form>
	</div>
	<div class="me-con2">
		<h4>反馈建议</h4>
		<lable>&Chi;</lable>
		<form action="#" method="post">
			<textarea required="required"></textarea>
			<input type="submit" value="提交">
		</form>
	</div>
	</body>

</html>